<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue 1</title>
</head>

<body>

<div id="app">
    <div>{{name}}</div>
    <div v-html="age"></div>
    <div>
        <a v-bind:href="url" :target="target">百度</a>
    </div>
    <div>{{say()}}</div>
    <div>
        <button v-on:click="eat('苹果')">点我</button>
        <button @click="eat('苹果')">点我</button>
    </div>
</div>

<script src="js/vue.min.js"></script>
<script>
    // document.getElementById('app').innerText = 'hello';
    new Vue({
        el: '#app',
        data: {
            // 普通文本
            name: 'xiaoming',
            // HTML 文本
            age: '<b>20</b>',
            // 给标签的属性绑定值
            url: 'https://www.baidu.com',
            target: '_blank'
        },
        methods: {
            say: function () {
                return 'nihao';
            },
            eat: function (food) {
                alert('吃' + food);
            }
        }
    });
</script>
</body>
</html>